//
//  CategoryCollectionViewCell.m
//  FunnyVideo
//
//  Created by 李鑫 on 15/11/4.
//  Copyright © 2015年 NewEggTech. All rights reserved.
//
#import "UIImage+Detect.h"
#import "CategoryCollectionViewCell.h"

@implementation CategoryCollectionViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)showBottomLine:(BOOL)isShow animated:(BOOL)animated{
    if(animated)
    [UIView animateWithDuration:0.5 delay:0.0 usingSpringWithDamping:3.0 initialSpringVelocity:4.0 options:0 animations:^{
        UIColor *detectColor = [[self.cellImgBtn backgroundImageForState:UIControlStateNormal] detectColor];
        self.cellNameLabel.textColor = detectColor;
    } completion:^(BOOL finished) {
        
    }];
    else
        self.cellNameLabel.textColor = [[self.cellImgBtn backgroundImageForState:UIControlStateNormal] detectColor];
}

- (void)showBottomLine:(BOOL)isShow animated:(BOOL)animated completion:(void (^)())completion{
    if(animated)
        [UIView animateWithDuration:0.5 delay:0.0 usingSpringWithDamping:3.0 initialSpringVelocity:4.0 options:0 animations:^{
            UIImage *image = [self.cellImgBtn backgroundImageForState:UIControlStateNormal];
            UIColor *detectColor = [image detectColor];
            self.cellNameLabel.textColor = detectColor;
        } completion:^(BOOL finished) {
            completion();
        }];
    else
    {
        self.cellNameLabel.textColor = [[self.cellImgBtn backgroundImageForState:UIControlStateNormal] detectColor];
        completion();
    }
}
@end
